﻿using FikriKibar.Entities.Composite.BaseModels;
using FikriKibar.Entities.Concrete;
using FikriKibar.Globalization;
using FluentValidation;

namespace FikriKibar.Common.Validation.FluentValidation.UserGroup
{
    public class AddRules : AbstractValidator<AddModel<UserGroupLanguageLine>>
    {
        public AddRules()
        {
            RuleFor(p => p.SelectedLanguageIds).NotEmpty().WithMessage(Resources.LanguageNotEmpty);
            RuleFor(p => p.Item.UserGroupName).NotEmpty().WithMessage(Resources.NameNotEmpty);
            RuleFor(p => p.Item.UserGroupName).Length(2, 100).WithMessage(Resources.NameLength);
        }
    }
}
